package com.ccc.javacv.pojo;

import lombok.AccessLevel;
import lombok.Data;
import lombok.Setter;

import java.util.Collection;
import java.util.concurrent.ConcurrentLinkedQueue;

/***
 * 任务上下文
 */
@Data
public class TaskContext {
    private String id;

    private VideoInfo videoInfo;

    /**
     * 是否设置为不自动关闭
     */
    private boolean notAutoClose;

    private Long lastNoClientTime;

    /**
     * 视频源协议，例rstp
     */
    private String sourceProtocol;

    /**
     * 客户端列表，私有化setter方法，禁止使用，而通过add添加
     */
    @Setter(AccessLevel.PRIVATE)
    private Collection<ClientInfo> clientList = new ConcurrentLinkedQueue<>();

    /**
     * toString
     */
    @Override
    public String toString() {
        return "TaskContext{" +
                "id='" + id + '\'' +
                ", videoInfo=" + videoInfo +
                ", notAutoClose=" + notAutoClose +
                '}';
    }
}
